var vm = new Vue({
  el: "#noteApp",
  data() {
    let imgBaseUrl = "./image/ca";
    return {
      todo: "",
      list: ["唱歌", "跳舞", "打篮球"],
      audioSrc: "music.163.com/outchain/player?type=3&id=2065193305",
      isBg: false,
      carouselPic: [
        `${imgBaseUrl}1.gif`,
        `${imgBaseUrl}2.gif`,
        `${imgBaseUrl}3.gif`,
        `${imgBaseUrl}4.gif`,
      ],
    };
  },
  methods: {
    conf() {
      if (window.confirm("啊?你干嘛")) {
        this.list = [];
      } else {
        this.audioSrc = "";
      }
    },
    add() {
      this.list.push(this.todo);
      this.todo = "";
    },
    del(index) {
      this.list.pop(index);
      this.audioSrc = "";
    },
    delAll() {
      this.audioSrc = "audio/你干嘛.mp3";
      this.conf();
    },
    changBg() {
      this.isBg = !this.isBg;
      var bodyRef = document.querySelector("body");
      if (this.isBg) {
        bodyRef.style.backgroundImage = "url('bg1.gif')";
      } else {
        bodyRef.style.backgroundImage = "url('bg2.gif')";
      }
    },
  },
});
